package com.health.trans.service.action;

import com.health.entity.BaseRegister;
import com.health.entity.OpcSeeDoctor;
import com.health.es.entity.log.TransformLog;
import com.health.trans.service.CorrelationService;
import lombok.extern.slf4j.Slf4j;

/**
 * @author nqlz
 */
@Slf4j
public class OpcSeeDoctorAction extends TransAction<OpcSeeDoctor, Object> {


    protected OpcSeeDoctorAction(CorrelationService correlationService) {
        super(correlationService);
    }

    @Override
    public void transData(OpcSeeDoctor t) {
        TransformLog transformLog = correlationService.correlation(t);
        if (null == transformLog) {
            //关联性校验通过
            BaseRegister baseRegister = new BaseRegister(t.getHospCode(), t.getTreatmentNo(), t.getCardType(), t.getCardNum());
            memorySet.pushOther(BaseRegister.class, baseRegister);
            memorySet.pushOther(tClass,t);
        } else {
            //未关联到数据
            memorySet.pushLog(transformLog);
        }
    }
}
